$(function () {
    $(".save").click(function () {
        var lan={};
        lan.lanename =$("input[name=lanename]").val();
        lan.guiding =$("input[name=guiding]").val();
        lan.ip =$("input[name=ip]").val();
        lan.guidingport =$("input[name=guidingport]").val();
        lan.status =$("input[type=checkbox]").val();
        var arr=[];

        for(var i=0;i<6;i++){
            var geomagnetic={};
            geomagnetic.rr=$("input[name=lanename"+i+"]").val();

        }
        var lanename =$("input[name=lanename]").val();
        var lanename =$("input[name=lanename]").val();
        var lanename =$("input[name=lanename]").val();
    });
});


function tlane(name) {
    $('.'+name+'sss').html("");

}

function lanenamet() {
    var lanename=$("input[name=lanename]").val();
    if(null==lanename||""==lanename){
        $('.lanenamesss').html("不能为空！");
        return false;
    }else {
        return true;
    }

}
function guidingt() {
    var guiding=$("input[name=guiding]").val();
    if(null==guiding||""==guiding){
        $('.guidingsss').html("不能为空！");
        return false;
    }else {
        return true;
    }

}
function ipt() {
    var ip=$("input[name=ip]").val();
    var regex=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
    if(null==ip||""==ip){
        $('.ipsss').html("不能为空！");
        return false;
    }
    if(!regex.test(ip)){
        $('.ipsss').html("ip输入不正确");
        return false;
    }else {
        return true;
    }
}
function guidingportt() {
    var guidingport=$("input[name=guidingport]").val();
    var regex=/^[0-9]*$/;
    if(null==guidingport||""==guidingport){
        $('.guidingportsss').html("不能为空！");
        return false;
    }
    if(!regex.test(guidingport)){
        $('.guidingportsss').html("必须是数字");
        return false;
    }else {
        return true;
    }
}